package com.yzh.openai.domain.openai.model.aggregates;

import com.yzh.openai.domain.openai.model.entity.MessageEntity;
import com.yzh.openai.domain.openai.model.valobj.ModelTypeVO;
import com.yzh.openai.types.enums.AIModel;
import com.yzh.zhipu.model.vo.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChatProcessAggregate {
    private String openid;
    private Model model = Model.GLM_3_TURBO;
    private List<MessageEntity> messages;

    public ModelTypeVO getModelType() {
        if (AIModel.COGVIEW_3.getCode().equals(model.getCode())) return ModelTypeVO.IMAGE;

        return ModelTypeVO.TEXT;
    }
}
